<?php
	include_once $ubi['SERVER']['SERVER_ROOT'] . '/dao/daoUpdate.php';
	
	class UpdateBus {
		private $_updateDao;

		public function __construct() {
			$this->_updateDao = new UpdateDao();
		}
	
		public function addUpdate($update) {
			if (!$update->getModifiedDate()) {
				$currentTime = $_SERVER['REQUEST_TIME'];
				$update->setModifiedDate($currentTime);
			}
			
			$this->_updateDao->addUpdate($update);
		}
		
		public function getUpdatesOfUser($userID) {
			return $this->_updateDao->getUpdatesOfUser($userID);
		}
		
		public function getUpdatesOfFriends($userID) {
			return $this->_updateDao->getUpdatesOfFriends($userID);
		}
	} 
?>